import Inventory from "./inventory/index.vue";
import SplitOrder from "./splitOrder/index.vue";
export const list = [
  {
    key: "kcqx",
    title: "库存权限",
    component: Inventory
  },
  {
    key: "cdpz",
    title: "拆单配置",
    component: SplitOrder
  }
];

export const dealStoreList = storeList => {
  let tempList = [];
  storeList.forEach(store => {
    let areaObj = tempList.find(v => v.id == store.areaId);
    if (areaObj) {
      areaObj.children.push({
        id: store.id,
        storeName: store.storeName
      });
    } else {
      tempList.push({
        id: store.areaId,
        storeName: store.areaName,
        children: [
          {
            id: store.id,
            storeName: store.storeName
          }
        ]
      });
    }
  });
  return tempList;
};
